package com.mall.service.commodity.controller;

import com.mall.commons.common.CommonResult;
import com.mall.model.domain.PmsSkuStock;
import com.mall.service.commodity.service.SkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName SkuController
 * @Description sku库存
 * @Author dcq
 * @Date 2023/3/13 19:25
 * @Version 1.0
 */
@RestController
@RequestMapping("/sku")
public class SkuController {
    @Autowired
    private SkuService service;
    @PostMapping("/update/{pid}")
    public CommonResult updatePid(@PathVariable Integer pid,@RequestBody List<PmsSkuStock>  skuStockList){
          service.updateSei(pid,skuStockList);
          return CommonResult.success("修改成功");
    }
    @GetMapping("/{pid}")
    public CommonResult<List<PmsSkuStock>> getId(@PathVariable Integer pid,String keyword){
       List<PmsSkuStock> body=service.getId(pid,keyword);
        return CommonResult.success(body);
    }
}